Field of the Invention
The present invention relates to an apparatus, a program, and a method for generating a mapping between individual properties included in an object in a program and the individual elements of a structured document.
Description of Related Art
Methods for converting Extensible Markup Language (XML) documents to objects handled by programs are known. “Document Object Model (DOM) Level 3 Core Specification,” Apr. 7, 2004, W3C discloses the specifications of the Document Object Model (DOM) that is an application program interface for programs to access XML documents. “JSR 222: Java Architecture for XML Binding (JAXB) 2.0,” Java Community Process discloses the specifications of the Java Architecture for XML Binding (JAXB) that provides the facility of a schema compiler and a schema generator for converting XML documents to Java (registered trademark) objects and converting Java objects to XML documents.
Also, methods for converting an object in a program to an XML document have been known. For example, in the DOM reference described above, an XML document can be generated from an object in which the individual elements of a converted XML document are reflected in advance. In the JAXB reference described above, an XML schema can be automatically generated from the class of a Java object, and an XML document can generated from the Java object on the basis of the automatically generated XML schema.
“Castor XML Mapping,” ExoLab Group, Intalio Inc., and “JiBX: Binding XML to Java Code,” Sosnoski Software Solutions Inc., disclose data binding tools for performing mapping between XML documents and objects. Any object can be converted to an XML document using such tools or libraries or PHP (a programming language for hypertext processing) SOAP functions.
Japanese Unexamined Patent Application Publication No. 2003-256455 discloses a method for converting XML documents to data models other than objects. Philip Bille, “A survey on tree edit distance and related problems,” June 2005 discloses solutions to the tree editing problem, i.e., a problem of calculating the edit cost and procedure for obtaining the same tree structure as a second tree structure by editing a first tree structure.
The aforementioned processes for converting an object in a program to an XML document are complicated and often inconvenient for programmers. For example, in the DOM reference, unless an object in which the elements of an XML document are accurately reflected is generated in advance using a program, conversion cannot be performed appropriately. In the JAXB reference, an object not being a class that was used to generate an XML schema cannot be converted to an XML document. Even with the tools or libraries described in the ExoLab Group and Sosnoski Software references or PHP SOAP functions, programmers need to describe correspondences between the individual properties of an object of a program and the individual elements of a structured document in advance. Moreover, such description needs to be provided for the classes of all objects and the elements of all XML documents.